package evostar.result;

import lombok.Data;

@Data
public class CodeMsg {
    private int code;
    private String msg;

    private CodeMsg(int code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    //通用
    public static CodeMsg SUCCESS = new CodeMsg(200, "success");
    public static CodeMsg SERVER_ERROR = new CodeMsg(500, "服务器异常");
    public static CodeMsg ACCESS_ERROR = new CodeMsg(501, "非法访问");
    public static CodeMsg ACCESS_TOO_MANY = new CodeMsg(501, "访问太频繁");

    //登录
    public static CodeMsg ACCOUNT_EMPTY = new CodeMsg(40001, "账号不能为空");
    public static CodeMsg ACCOUNT_ERROR = new CodeMsg(40002, "账号错误");
    public static CodeMsg PASSWORD_EMPTY = new CodeMsg(40003, "密码不能为空");
    public static CodeMsg PASSWORD_ERROR = new CodeMsg(40004, "密码错误");
    public static CodeMsg ACCOUNT_NOT_EXIST = new CodeMsg(40005, "账号不存在");
    public static CodeMsg SESSION_ERROR = new CodeMsg(40006, "session失效");

    //秒杀
    public static CodeMsg STOCK_EMPTY = new CodeMsg(40007, "库存不足");
    public static CodeMsg ORDER_AGAIN = new CodeMsg(40008, "重复下单");


}
